/**
 * Yolema.com Inc.
 * Copyright (c) 2011-2012 All Rights Reserved.
 */
package org.grayrabbit.pay.facade;

import org.grayrabbit.pay.facade.bean.ChinaPayForm;
import org.grayrabbit.pay.facade.bean.ChinaPayTrade;
import org.grayrabbit.pay.facade.bean.TradeMapping;
import org.grayrabbit.pay.facade.bean.TradeReturn;
import org.grayrabbit.pay.facade.common.Result;
import org.grayrabbit.pay.facade.common.TradeConstants.RefundCode;
import org.grayrabbit.pay.facade.common.TradeConstants.TradeCode;

/**
 * 
  * 支付平台统一接口
 * 
 * <li>对于部分接口需开发对应的权限
 * <li>只能返回本系统对应的订单信息
 * <li>生成银联收款单、申请退款、验证订单(退款、收款)
 * <li>通知收款成功、通知退款成功|失败
 * 
 * @author wy
 * @version $Id: Trade.java, v 0.1 2012-6-5 上午9:41:54 wy Exp $
 */
public interface ChinapayClient {

    /**
     * 生成银联收款表单
     * 
     * @param chinaPayTrade
     * @return
     */
    public Result<ChinaPayForm> getChinaPayForm(ChinaPayTrade chinaPayTrade);

    /**
     * 发起银联退款,只有交易完成的订单才可以退款
     * 
     * @param chinaPayTrade
     * @return
     */
    public Result<ChinaPayForm> getChinaPayRefundForm(ChinaPayTrade chinaPayTrade);

    /**
     * 查询退款状态
     * 
     * @param chinaPayTrade
     * @return
     */
    public Result<RefundCode> refundResult(ChinaPayTrade chinaPayTrade);

    /**
     * 获取支付结果状态
     * 
     * @param chinaPayTrade
     * @return
     */
    public Result<TradeCode> payResult(ChinaPayTrade chinaPayTrade);

    /**
     * 获取交易对照
     */
    public Result<TradeMapping> payMappingByTrans(TradeReturn tradeReturn);

}
